/* Documentation Styles for AllBeAPI */

/* Layout */
.docs-layout {
    display: grid;
    grid-template-columns: 280px 1fr 200px;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 120px);
}

/* Sidebar */
.docs-sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: var(--primary-color);
    color: white;
}

.nav-sublist {
    margin-left: 1rem;
    margin-top: 0.25rem;
}

.nav-sublist .nav-link {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
}

/* Main Content */
.docs-main {
    min-width: 0; /* Prevent overflow */
}

.docs-content {
    max-width: none;
}

.docs-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.docs-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.docs-lead {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.api-info-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.api-info-item {
    font-size: 0.9rem;
}

.api-info-item strong {
    color: var(--text-primary);
}

.api-info-item code {
    background: var(--bg-primary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Sections */
.docs-section {
    margin-bottom: 4rem;
}

.docs-section h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.docs-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.docs-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.docs-section p {
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* API Endpoints */
.api-endpoint {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.endpoint-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.endpoint-method {
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
}

.endpoint-url {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Parameters Table */
.params-table {
    margin: 1.5rem 0;
    overflow-x: auto;
}

.params-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.params-table th,
.params-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.params-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.params-table td {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.params-table code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Code Blocks */
.docs-content pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    position: relative;
}

.docs-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
}

.copy-code-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}

.docs-content pre:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background: var(--bg-secondary);
}

/* Feature Comparison */
.feature-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.comparison-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
}

.comparison-card h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.comparison-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comparison-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.comparison-card li:last-child {
    border-bottom: none;
}

.comparison-card li::before {
    content: '✅';
    position: absolute;
    left: 0;
    top: 0.5rem;
}

/* Installation Options */
.installation-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.install-option {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.install-option h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--text-primary);
}

/* Method Grid */
.method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.method-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.method-card h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.method-card pre {
    margin: 0;
    font-size: 0.85rem;
}

/* Best Practices Grid */
.best-practices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.practice-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.practice-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.practice-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.practice-card li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.9rem;
}

.practice-card li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Error Codes Table */
.error-codes-table {
    margin: 2rem 0;
}

.error-codes-table h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.error-codes-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.error-codes-table th,
.error-codes-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.error-codes-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.error-codes-table td {
    color: var(--text-secondary);
}

.error-codes-table code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Response Notes */
.response-note {
    background: var(--info-color);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.response-note strong {
    font-weight: 600;
}

/* Table of Contents */
.docs-toc {
    position: sticky;
    top: 120px;
    height: fit-content;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.docs-toc h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.toc-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-nav li {
    margin-bottom: 0.25rem;
}

.toc-nav a {
    display: block;
    padding: 0.25rem 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 0.85rem;
}

.toc-nav a:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.toc-cta {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.toc-cta h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.toc-cta p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Example Tabs */
.example-tabs {
    margin: 2rem 0;
}

.tab-buttons {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    border-right: 1px solid var(--border-color);
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn.active,
.tab-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.tab-content {
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    background: var(--bg-primary);
}

.tab-pane {
    display: none;
    padding: 2rem;
}

.tab-pane.active {
    display: block;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .docs-layout {
        grid-template-columns: 250px 1fr;
        gap: 1.5rem;
    }
    
    .docs-toc {
        display: none;
    }
}

@media (max-width: 768px) {
    .docs-layout {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .docs-sidebar {
        position: static;
        order: -1;
    }
    
    .feature-comparison,
    .installation-options,
    .method-grid,
    .best-practices-grid {
        grid-template-columns: 1fr;
    }
    
    .endpoint-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .api-info-card {
        grid-template-columns: 1fr;
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .tab-btn {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .tab-btn:last-child {
        border-bottom: none;
    }
}

/* Print Styles */
@media print {
    .docs-sidebar,
    .docs-toc,
    .copy-code-btn {
        display: none;
    }
    
    .docs-layout {
        grid-template-columns: 1fr;
    }
    
    .docs-content {
        max-width: none;
    }
}
